import pymysql

client = pymysql.connect(
    host='localhost',
    user='root',
    password='123456',
    db='hugo',
    port=3306,
    charset='utf8'
)
cursor = client.cursor(pymysql.cursors.DictCursor)

sql = 'select * from xishi_view'
cursor.execute(sql)
print(cursor.fetchall())
client.commit()

cursor.close()
client.close()